<script setup lang='ts'>
import { PureTableBar } from "@/components/RePureTableBar";
import { useEBusinessPayment } from "./hooks/EBusinessPayment";
const {
  rules,
  columns,
  loading,
  dataList,
  pagination,
  handleSizeChange,
  handleCurrentChange,
  DialogVisible,
  EntryPlatform,
  RefEntryPlatform,
  rowData,
  handleLender,
  CloseEntryPlatform,
  SubtimEntryPlatform,
  confirmPay,
  handlePay,
  payVisible,
  payTittle,
} = useEBusinessPayment()
</script>
    <!-- 入住电商平台 -->
<template>
  <div class="main">
    <PureTableBar title="付款结算列表" class="list_hei">
      <template v-slot="{ size, checkList }">
        <pure-table border align-whole="center" showOverflowTooltip table-layout="auto" adaptive :loading="loading"
          size="small" :data="dataList" max-height="600" :columns="columns" :checkList="checkList"
          :pagination="pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange"
          :header-cell-style="{
            background: 'var(--el-table-row-hover-bg-color)',
            color: 'var(--el-text-color-primary)'
          }">
          <template #operation="{ row }">
            <div v-if="row.duePayment == false">
              <el-button type='primary' size="small" text @click="handlePay(row)">
                结算
              </el-button>
            </div>
            <div v-else><el-button type='primary' size="small" text>
                已结算
              </el-button></div>

          </template>
        </pure-table>
      </template>
    </PureTableBar>
  </div>


  <ReDialog :width="500" :height="150" :models="payVisible" @Closes="payVisible = false">
    <template #header>
      <h2 style=" text-align: center;">操作</h2>
    </template>
    <template #main>
      <span class=" h-full flex justify-center f-14 flex-direction-column"> {{ payTittle }}</span>
    </template>
    <template #footer>
      <span class="dialog-footer">
        <el-button type="primary" @click="confirmPay()">确定</el-button>
        <el-button @click="payVisible = false"> 取消 </el-button>
      </span>
    </template>
  </ReDialog>
</template>

<style scoped lang="scss">
@import url(@/style/CreditComm.scss);

:deep(.el-dialog__footer) {
  text-align: center;
}
</style>
